
# 二分查找

def midSearch(n,num):
    mid = len(n)//2
    min = 0
    max = len(n)
    while min<=max:
        if n[mid] == num:
            return mid
            break
        elif n[mid]>num:
            max = mid - 1
            mid = (min + max) // 2
        elif n[mid]<num:
            min = mid + 1
            mid = (min + max) // 2
    return -1

if __name__ == "__main__":
    arr = input()
    n = [int(i) for i in arr.split()]
    num = int(input())
    result = midSearch(n,num)
    print(result)